using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Mvc.Ajax;
using etcetera.Mvc.UI.Calendar;
using Samples.Models;

namespace Samples.Controllers
{
    public class CalendarController : Controller
    {
        //
        // GET: /Calendar/
        //
        public ActionResult Index(int? year, int? month)
        {
            year = year ?? DateTime.Now.Year;
            month = month ?? DateTime.Now.Month;
            
            CalendarViewModel viewModel = new CalendarViewModel();
            viewModel.Year = year.Value;
            viewModel.Month = month.Value;
            var calendarEntries = new List<ICalendarEntry>
                                      {
                                          new CalendarEntry(DateTime.Now.Date, "Meeting", Url.Action("Entry", new {id = 1})),
                                          new CalendarEntry(DateTime.Now.Date.AddDays(1), "Appointment", Url.Action("Entry", new {id = 2})),
                                          new CalendarEntry(DateTime.Now.Date.AddDays(2), "Milestone", Url.Action("Entry", new {id = 3})),
                                          new CalendarEntry(DateTime.Now.Date.AddDays(3), "Party", Url.Action("Entry", new {id = 4})),
                                          new CalendarEntry(DateTime.Now.Date.AddDays(4), "Toms Birthday", Url.Action("Entry", new {id = 5}))
                                      };
            viewModel.CalendarEntries = calendarEntries;

            return View(viewModel);
        }

        public ActionResult Date(int y, int m, int d)
        {
            // Get the date data...
            return View();
        }
        
        public ActionResult Entry(int? id)
        {
            // Get the entry data...
            return View();
        }
    }
}
